package com.server;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.db.DB;
import com.tools.Constants;

public class C2S6PushPage extends HttpServlet {
	@Override
	public void init() throws ServletException {
		Constants.init();
		System.out.println("DB name:" + Constants.DBNAME);
		DB.connDB();
		super.init();
	}

	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html;charset=utf-8");
		Enumeration<String> er = request.getParameterNames();
		System.out.println("[vswb6] whitebox6 post begin");
		System.out.println("版本> 13");
		PrintWriter writer = response.getWriter();
		String user_id = null;
		String cmd = null;
		String time = null;
		String location = null;
		while (er.hasMoreElements()) {
			String element = er.nextElement();
			
			if (element.equals("user_id")) {
				user_id = request.getParameterValues("user_id")[0];
			}
			if (element.equals("cmd")) {
				cmd = request.getParameterValues("cmd")[0];
			}
			if (element.equals("time")) {
				time = "time";
			}
			if (element.equals("location")) {
				location = "location";
			}
		}
		if(user_id != null){
			writer.print("<div id='head'><p id='title' align='center' >最新动态</p></div>");
			writer.print("<div id='0' class='content' ><img src='http://115.238.95.2:8089/tom/res/img/newyear.jpg' width='260' height='180'></img></div>");
			writer.print("<div id='0' class='content' ><p id='content' width='80' height='300' ><strong id='name'>易物推送消息</strong><br><br><br><br> <br><br>合作网站:易物时代<br><br>http://www.5115china.com/home.asp<br><br>2011年3月2日</p></div>");
			writer.print("<div id='0' class='content' ><p id='content' width='80' height='300' ><strong id='name'>易物推送消息</strong><br><br><br>易物已经更新至17版。17版增加了职业分类，很漂亮哦！如果你点击更新按钮没反映，说明你是小于14版用户。请从各大market或者官网上更新至17版。<br><br> 合作伙伴:<br> 安智市场<br> 安桌市场hiapk<br>  优亿市场<br> 机锋市场<br><br><br><br>官方网站:<br>http://115.238.95.2:8089/yiwu.html 网站更漂亮哦！<br><br><button width='90' height='90' id='reinstall'>更新版本</button><br><br>2011年2月12日</p></div>");
			writer.print("<div id='0' class='content' ><p id='content' width='80' height='300' ><strong id='name'>易物推送消息</strong><br><br><br>小技巧<br><br>上下拖动屏幕会获取更多内容哦<br><br>在各个页面，上下反复拖动几次就可刷新新数据<b<br><br>2011年2月12日</p></div>");
			writer.print("<div id='0' class='content' ><p id='content' width='80' height='300' ><strong id='name'>易物推送消息</strong><br><br><br>易物qq群:7641672.<br><br><br><b<br>2011年1月19日</p></div>");
			
		}
	}
}
